// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
	compatibilityDate: '2025-07-15',
	devtools: { enabled: false },
	build: {
		transpile: ['naive-ui', 'vueuc', 'vooks']
	},

	css: [
		'@/assets/css/iconfont.css',
		'@/assets/css/common.css',
		'@/assets/css/style.css'
	],

	modules: [
		'@unocss/nuxt',
	],

	// ✅ 启用 SSR，但添加防 Hydration mismatch 的配置
	ssr: true,

	vue: {
		compilerOptions: {
			// 防止自定义组件名被错误识别
			isCustomElement: (tag) => tag.startsWith('client-only-'),
		},
	},

	experimental: {
		// 保持渲染行为稳定，避免 JSON payload 差异导致 mismatch
		renderJsonPayloads: false,
		payloadExtraction: false,
	},

	hooks: {
		'vue:setup'(vueApp) {
			if (process.client) {
				const originalWarn = console.warn
				console.warn = (...args) => {
					if (args[0] && args[0].includes('Hydration completed')) return
					originalWarn(...args)
				}
			}
		},
	},

	nitro: {
		compressPublicAssets: true, // 压缩静态资源
	},

	app: {
		head: {
			title: 'CHAT SEX HATTI ',
			meta: [
				{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' },
				{ name: 'description', content: 'Online video chat, sexy beauties, 24-hour customer service' },
			],
		},
	},

	vite: {
		logLevel: 'info'
	}
})